package reflectdemo;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 刘远望
 * Date: 2025-05-01
 * Time: 16:59
 */
public class Student {

    private String name = "Lyw";
    public int age = 18;

    public Student() {
        System.out.println("student");
    }

    private Student(String name, int age) {
        this.name = name;
        this.age = age;
        System.out.println("Student(String, name)");

    }

    private void eat() {
        System.out.println("i am eat");
    }

    public void sleep() {
        System.out.println("i an pig");
    }

    private void func(String str) {
        System.out.println(str);
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
